// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_INV_STG
// * CreateDate    : 2014-06-05 18:30:11
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:11
// * LastChanger   : 2014-06-05 18:30:11
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class InvStgEntity : EntityBase
    {
        public InvStgTable TableSchema
        {
            get
            {
                return InvStgTable.Current;
            }
		}
		
		public InvStgEntity()
        {

        }
		
		public InvStgEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.CurrentQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CURRENT_QTY"]));
			this.FixedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FIXED_QTY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.IsFull = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_FULL"]));
        }
		
		public InvStgEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.LocationId = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.CurrentQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["CURRENT_QTY"]));
			this.FixedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["FIXED_QTY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.IsFull = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_FULL"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return InvStgTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(InvStgTable.C_ID)); }
            set { SetData(InvStgTable.C_ID, value); }
        }
		
        [DataMember]
        public string LocationId
        {
            get { return Convert.ToString(GetData(InvStgTable.C_LOCATION_ID)); }
            set { SetData(InvStgTable.C_LOCATION_ID, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(InvStgTable.C_PRODUCT_ID)); }
            set { SetData(InvStgTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public decimal CurrentQty
        {
            get { return Convert.ToDecimal(GetData(InvStgTable.C_CURRENT_QTY)); }
            set { SetData(InvStgTable.C_CURRENT_QTY, value); }
        }
		
        [DataMember]
        public decimal FixedQty
        {
            get { return Convert.ToDecimal(GetData(InvStgTable.C_FIXED_QTY)); }
            set { SetData(InvStgTable.C_FIXED_QTY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(InvStgTable.C_UPDATED_DATE)); }
            set { SetData(InvStgTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public int IsFull
        {
            get { return Convert.ToInt32(GetData(InvStgTable.C_IS_FULL)); }
            set { SetData(InvStgTable.C_IS_FULL, value); }
        }
		
		#endregion
	}
	
	
}	

